#include <iostream>
#include <string>

using namespace std;


class person
{
public:
    string name;
    string sex;
    int age;

public:
    person() {}
    person(string name , int age) : name(name) , age(age) {}
    person(string name , int age , string sex) : name(name) , age(age) {}
    ~person() {}

public:
    void show()
    {
        cout << " 名字:" << name << " 性别:" << sex <<" 年龄:" << age << endl; 
    }


};


class Student : public person
{
public:
    int id;
    int soc;

public:
    Student( );

    Student(string name , int age , string sex , int id , int soc) :
     person( name ,  age ,  sex) , id(id) , soc(soc) {}
    ~Student() {}

public:
    void show()
    {
        person::show(); // 类内 调用
        cout << " 名字:" << person::name << " 性别:" << person::sex <<" 年龄:" << person::age  << " 学号:" << id << " 成绩:" << soc << endl;
    }

};


int main(int argc, char const *argv[])
{
    
    Student S1("川普" , 78 , "男" , 1 , 59);

    S1.show();

    S1.person::show(); // 类外调用函数
    S1.person::name = "李四";   // 类外调用 父类 的成员变量
    
    S1.show();
    return 0;
}
